package com.lkcg.demo.common.mybatis;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.log4j.Log4j;

import java.util.List;

/**
 * Created by virgilyan on 12/16/14.
 */

@Log4j
@Data
@ApiModel(description = "分页结果")
public class PagingResult<T> {
    // 当前页
    @ApiModelProperty(value = "当前页", name = "currentPage", example = "当前页")
    private int currentPage;

    // 总共记录条数
    @ApiModelProperty(value = "总共记录条数", name = "totalSize", example = "总共记录条数")
    private long totalSize;

    // 总共页数
    @ApiModelProperty(value = "总共页数", name = "totalPage", example = "总共页数")
    private int totalPage;

    // 结果集
    @ApiModelProperty(value = "结果集", name = "resultList", example = "结果集")
    private List<T> resultList;

    public PagingResult(int currentPage, long totalSize, int totalPage, List<T> resultList) {
        this.currentPage = currentPage;
        this.totalSize = totalSize;
        this.totalPage = totalPage;
        this.resultList = resultList;
    }

}
